/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.etecmatao.model;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author admin
 */
@Entity
@Table(name = "login")
@NamedQueries({
    @NamedQuery(name = "Login.findAll", query = "SELECT l FROM Login l")})
public class Login implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "email")
    private String email;
    @Basic(optional = false)
    @Column(name = "senha")
    private String senha;
    @Basic(optional = false)
    @Column(name = "status")
    private String status;
    @JoinTable(name = "login_funcao", joinColumns = {
        @JoinColumn(name = "email", referencedColumnName = "email")}, inverseJoinColumns = {
        @JoinColumn(name = "id_Funcao", referencedColumnName = "id_Funcao")})
    @ManyToMany
    private List<Funcao> funcaoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "login")
    private List<Professores> professoresList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "login")
    private List<Noticias> noticiasList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "login")
    private List<CategoriaDownload> categoriaDownloadList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "login")
    private List<Logs> logsList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "login")
    private List<Albuns> albunsList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "login")
    private List<Estagio> estagioList;
    @OneToOne(cascade = CascadeType.ALL, mappedBy = "login")
    private DadosUsuarios dadosUsuarios;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "login")
    private List<Fotos> fotosList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "login")
    private List<Campanhas> campanhasList;

    public Login() {
    }

    public Login(String email) {
        this.email = email;
    }

    public Login(String email, String senha, String status) {
        this.email = email;
        this.senha = senha;
        this.status = status;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getSenha() {
        return senha;
    }

    public void setSenha(String senha) {
        this.senha = senha;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public List<Funcao> getFuncaoList() {
        return funcaoList;
    }

    public void setFuncaoList(List<Funcao> funcaoList) {
        this.funcaoList = funcaoList;
    }

    public List<Professores> getProfessoresList() {
        return professoresList;
    }

    public void setProfessoresList(List<Professores> professoresList) {
        this.professoresList = professoresList;
    }

    public List<Noticias> getNoticiasList() {
        return noticiasList;
    }

    public void setNoticiasList(List<Noticias> noticiasList) {
        this.noticiasList = noticiasList;
    }

    public List<CategoriaDownload> getCategoriaDownloadList() {
        return categoriaDownloadList;
    }

    public void setCategoriaDownloadList(List<CategoriaDownload> categoriaDownloadList) {
        this.categoriaDownloadList = categoriaDownloadList;
    }

    public List<Logs> getLogsList() {
        return logsList;
    }

    public void setLogsList(List<Logs> logsList) {
        this.logsList = logsList;
    }

    public List<Albuns> getAlbunsList() {
        return albunsList;
    }

    public void setAlbunsList(List<Albuns> albunsList) {
        this.albunsList = albunsList;
    }

    public List<Estagio> getEstagioList() {
        return estagioList;
    }

    public void setEstagioList(List<Estagio> estagioList) {
        this.estagioList = estagioList;
    }

    public DadosUsuarios getDadosUsuarios() {
        return dadosUsuarios;
    }

    public void setDadosUsuarios(DadosUsuarios dadosUsuarios) {
        this.dadosUsuarios = dadosUsuarios;
    }

    public List<Fotos> getFotosList() {
        return fotosList;
    }

    public void setFotosList(List<Fotos> fotosList) {
        this.fotosList = fotosList;
    }

    public List<Campanhas> getCampanhasList() {
        return campanhasList;
    }

    public void setCampanhasList(List<Campanhas> campanhasList) {
        this.campanhasList = campanhasList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (email != null ? email.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Login)) {
            return false;
        }
        Login other = (Login) object;
        if ((this.email == null && other.email != null) || (this.email != null && !this.email.equals(other.email))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "admin.model.Login[email=" + email + "]";
    }

}
